package com.yangcangclub.commons.result;

/**
 * 自定义错误码
 */
public enum MessageEnum {

    SUCCESS(1000,"成功"),
    FAILURE(9999,"失败"),

    PARMA_SPECIAL_CHAR(1001,"参数包含特殊字符"),
    PARMA_IS_EMPTY(1002,"参数为空"),
    PARMA_FORMAT_ERROR(1003,"参数格式错误"),

    ACCESS_TOKEN_ERROR(1004,"access_token 错误"),
    ACCESS_TOKEN_NOT_FOUND(1005,"access_token 已过期失效"),
    REFRESH_TOKEN_ERROR(1009,"refresh_token 无效"),
    REFRESH_TOKEN_EXPIRE(1010,"refresh_token 过期失效"),
    ACCESS_OUT_LIMITS(1006,"访问次数超限，请稍后再试"),
    PERMISSION_DENIED(1007,"权限不足"),

    SET_PRIVILEGE_FAIL(1008,"设置用户权限失败"),
    REPEAT_OPERATION(7000,"重复操作"),

    USER_NOT_EXIST(1011,"用户不存在"),
    PARMA_RANGE_ERROR(1012,"参数取值范围错误"),
    REDIS_OPERATION_FAIL(1013,"Redis 操作失败"),
    IP_INFO_ERROR(1014,"IP 地址错误"),
    USER_FREEZE(1015,"账号已冻结"),
    USER_NOT_FOLLOW_SELF(1016,"自己就不要关注自己啦"),
    REQUEST_WEIXIN_FAIL(1800,"请求微信接口失败"),





    UPLOAD_FILE_EMPTY(1990,"上传文件不能为空"),
    UPLOAD_FILE_FORMAT_EROOR(1991,"上传文件类型错误"),
    UPLOAD_FILE_TOOMAX(1992,"上传文件过大"),
    UPLOAD_FILE_ERROR(1993,"上传文件失败"),

    UUID_ERROR(2003,"用户uuid错误"),
    USERNAME_OR_PWD_ERROR(2004,"用户名或密码错误"),
    USERNAME_IS_EXIST(2005,"用户名已存在"),
    PHONE_FORMAT_ERROR(2006,"手机号格式错误"),
    PHONE_NOT_EXIST(2007,"手机号不存在"),
    PHONE_IS_EMPTY(2008,"手机号为空"),
    PHONE_IS_EXIST(2009,"手机号已存在"),

    VERIFY_CODE_FAIL(2010,"验证码不正确，请重新输入；超过1分钟请重新获取"),

    PASSWORD_FORMAT_ERROR(2011,"密码格式错误"),
    PASSWORD_IS_ERROR(2012,"密码错误"),
    PASSWORD_IS_EMPTY(2013,"密码为空"),


    BIRTHDAY_FORMAT_ERROR(2014,"生日格式错误"),
    SEX_FORMAT_ERROR(2015,"性别格式错误"),


    NEWPASS_FORMAT_ERROR(2016,"新密码格式错误"),
    NEWPASS_IS_ERROR(2017,"新密码错误"),
    NEWPASS_IS_EMPTY(2018,"新密码为空"),

    MQ_SEND_FAIL(2019,"消息队列发送失败"),

    VERIFY_CODE_SHIXIAO_FAIL(2020,"验证码失效，请重新获取"),

    //商品模块错误码 3000系列
    PRODUCT_NOT_EXIST(3000,"商品不存在"),
    PRODUCT_SOLD_OUT(3001,"商品已下架"),
    TARGET_PRODUCT_NOT_FOUND(3002,"没找到目标商品或商品已下架"),
    TRY_AGAIN(3003,"修改失败，请再次尝试"),
    
    

    GET_SERVER_IP_ERROR(9992,"无法获取服务器IP！") ,
    PLEASE_REPLY(9993,"请重试！") ,
    TEMPLATE_ERROR(9994,"velocity template_执行错误") ,
    DATABASE_ERROR(9995,"db操作异常") ,
    SIGN_ERROR(9996,"接口签名错误") ,
    SYSTEM_INTERNAL_ERROR(9997,"系统异常") ,
    SYSTEM_UNKNOWN_ERROR(9998,"系统未知异常") ,
    
    

//
    PIC_CODE_NOT_DUI_ERROR(7109,"图片验证码输入错误"),
    PIC_CODE_NOT_EXIST_ERROR(7108,"请重新获取图片验证码"),
    REGION_FORMAT_ERROR(7107,"请选择手机注册区域"),
    VALID_CODE_FORMAT_ERROR(7106,"请输入正确的4位验证码"),
    PRAISE_EXIST_ERROR(7105,"已经点赞了"),
    COLLECT_EXIST_ERROR(7104,"已经收藏了"),
    PHONE_MAIL_FORGOT_ERROR(7103,"请输入手机、邮箱"),
    PHONE_MAIL_FORMAT_ERROR(7102,"目前仅支持手机、邮箱注册"),
    MAIL_FORMAT_ERROR(7101,"邮件格式错误"),
    MAIL_SEND_FAIL(7100,"请重试，邮件发送失败！"),
//
    ORDER_ADD_FAILURE(7200,"订单创建失败，请重试！"),
    ORDER_UPDATE_FAILURE(7201,"订单处理失败，请重试！"),
    ORDER_OPERATE_FAILURE(7203,"订单正在处理中，请稍后！"),
    INSUFFICIENT_GOODS(7204,"库存不足，无法交易！"),
    ILLEGAL_ORDER_STATUS_CHANGE(7205,"非法的订单状态变化"),
    IGNORE_RESPONSE(7206,"客户端忽略处理"),
    TOPIC_STATUS_ERROR(7207,"商品已下架，无法购买"),
    ERROR_ADDRESS(7208,"配送地址错误，请重新选择"),
    COMMODITY_REDUCE_FAILURE(7209,"库存不足，无法交易！"),
    ERROR_ORDER_STATUS(7210,"订单状态有误，请重新下单"),
    TOO_MANY_ADDRESSES(7211,"添加了太多收货地址，请删除一些"),
    STOCK_RECOVER_FAILURE(7211,"添加了太多收货地址，请删除一些"),
    PAY_DELAY_TIMEOUT(7212,"超过继续支付时间，请重新下单购买"),
    TOPIC_STOCK_ROLLBACK_FAILURE(7212,"超过继续支付时间，请重新下单购买"),
    PAY_TIMEOUT_ORDER_CANCEL_FAILURE(7213,"支付超时订单取消失败"),
    TOPIC_PRAICE_HAS_CHANGED(7214,"商品价格有变化，请重新下单"),
    IDGENERATOR_COULD_NOT_GET_WORKID(7215,"订单号生成器未获取到机器Id"),
    PAY_TYPE_FAILURE(7216,"支付类型不正确"),
    PRODUCT_QUANTITY_RESTRICTION(7217,"限购商品只能购买1件"),
    MISSING_PAYMENT_PARAMETERS(7218,"缺少支付参数openid"),
    TRADE_DETAILS_ADD_FAILURE(7219,"订单详细创建失败，请重试"),
    TRADE_ADDRESS_ADD_FAILURE(7220,"订单地址创建失败，请重试"),
    TRADE_REQ_LOG_ADD_FAILURE(7221,"发起交易支付失败，请重试"),
    ERROR_TRADE_UPDATE(7222,"订单信息更新失败，请重试"),
    ERROR_TRADE_NOT_FOUND(7223,"订单不存在，请重试"),
    TRADE_RESULT_REQ_LOG_ADD_FAILURE(7224,"交易返回结果保存失败，请重试"),
    TRADE_REQ_LOG_UPDATE_FAILURE(7225,"更新交易请求失败，请重试"),
    ERROR_TRADE_PAY_STATUS_UPDATE(7226,"订单支付状态更新失败，请重试"),
    ERROR_TRADE_DETAILS_UPDATE(7227,"订单支付状态更新失败，请重试"),
    ERROR_WECHAT_SIGN_FAILURE(7228,"微信支付签名错误，请重试"),
    ERROR_TRADE_PAY_TYPE_UPDATE(7229,"订单支付类型更新失败，请重试"),
    INVENTORY_UPDATE_FAILURE(7230,"库存更新失败，请重试"),
    ERROR_WECHAT_PAY_FAILURE(7231,"微信订单不是未支付状态，请重试"),
    USER_ADDRESS_UPDATE_FAILURE(7232,"地址更新错误，请重试"),
    REPEAT_ACTIVITIES_FAILURE(7233,"您已参与过限购商品的购买，请重试"),
    ERROR_MEMBER_EXCLUSIVE(7234,"限购商品只能会员购买"),
    ERROR_WECHAT_CLOSEORDER(7235,"微信支付关闭订单失败，请重试"),
    ERROR_WECHAT_ORDERQUERY(7236,"微信支付订单查询失败，请重试"),
    ERROR_WECHAT_REFUNDQUERY(7237,"微信支付查询退款失败，请重试"),
    ERROR_ALIPAY_ORDERQUERY(7238,"支付宝订单查询失败，请重试"),
    ERROR_TRADEREFUND_PRICE(7239,"退款金额不正确，请重试"),
    ERROR_TRADEREFUND_TYPE(7240,"退款类型不正确，请重试"),
    ERROR_TRADEREFUND_STATUS(7241,"该订单状态无法发起退款，请重试"),
    ERROR_TRADEREFUND_EXIST(7242,"该订单已发起过退款，不允许申请整单退款"),
    ERROR_TRADEREFUND_PRODUCT_EXIST(7243,"该商品已发起过退款，不允许再次申请退款"),
    ERROR_TRADEREFUND_NOTFOUND(7244,"退款申请记录不存在"),
    ERROR_TRADEREFUND_UPDATE(7245,"退款信息更新失败，请重试"),
    ERROR_TRADEREFUND_NOPAYLOG(7246,"没有支付记录，无法发起退款申请，请重试"),
    ERROR_ACTIVITY_NOT_STARTED(7247,"您抢购的商品活动还未开始，请稍后"),
    ERROR_ACTIVITY_IS_OVEER(7248,"您抢购的商品活动已经结束"),
    ERROR_TRADEREFUND_ISLIMIT(7249,"限购商品无法发起退款"),
    PRODUCT_QUANTITY_TOO_MANY(7250,"商品最多仅限购买99件"),
    PRODUCT_QUANTITY_TOO_LITTLE(7251,"商品最少购买1件"),
    ERROR_MEMBER_EXCLUSIVE_2(7252,"此商品仅限会员购买"),
    ;


    MessageEnum(int code,String desc) {
        this.code = code;
        this.desc = desc;
    }

    private int code;
    private String desc;
    public int getCode() {
        return code;
    }
    public String getDesc() {
        return desc;
    }




}
